#include <errno.h>
#include <string.h>
+#include "gtkcssenumvalueprivate.h"
#include "gtkiconfactory.h"
#include "gtkiconcache.h"
#include "gtkdebug.h"
#include "gtkbuilderprivate.h"
#include "gtktypebuiltins.h"
#include "gtkstyle.h"
+#include "gtkstylecontextprivate.h"
/**
* SECTION:gtkiconfactory
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size,
- gint scale);
+ gint scale,
+ GtkCssImageEffect effect);
static void add_to_cache (GtkIconSet *icon_set,
GtkStyleContext *style_context,
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size,
gint scale,
+ GtkCssImageEffect effect,
GdkPixbuf *pixbuf);
/* Clear icon set contents, drop references to all contained
* GdkPixbuf objects and forget all GtkIconSources. Used to
GtkStateFlags flags = 0;
GtkStateType state;
GtkTextDirection direction;
+ GtkCssImageEffect effect;
g_return_val_if_fail (icon_set != NULL, NULL);
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
direction = gtk_style_context_get_direction (context);
G_GNUC_END_IGNORE_DEPRECATIONS;
+ effect = _gtk_css_image_effect_value_get
+ (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_GTK_IMAGE_EFFECT));
+
if (icon_set->sources)
{
- icon = find_in_cache (icon_set, context, direction, state, size, scale);
+ icon = find_in_cache (icon_set, context, direction, state, size, scale, effect);
if (icon)
return g_object_ref (icon);
}
if (icon == NULL)
icon = render_fallback_image (context, direction, state, size);
- add_to_cache (icon_set, context, direction, state, size, scale, icon);
+ add_to_cache (icon_set, context, direction, state, size, scale, effect, icon);
return icon;
}
GtkStateType state;
GtkIconSize size;
gint scale;
+ GtkCssImageEffect effect;
GdkPixbuf *pixbuf;
};
}
static GdkPixbuf *
-find_in_cache (GtkIconSet *icon_set,
- GtkStyleContext *style_context,
- GtkTextDirection direction,
- GtkStateType state,
- GtkIconSize size,
- gint scale)
+find_in_cache (GtkIconSet *icon_set,
+ GtkStyleContext *style_context,
+ GtkTextDirection direction,
+ GtkStateType state,
+ GtkIconSize size,
+ gint scale,
+ GtkCssImageEffect effect)
{
GSList *tmp_list;
GSList *prev;
if (icon->style == style_context &&
icon->direction == direction &&
icon->state == state &&
+ icon->effect == effect &&
(size == (GtkIconSize)-1 || icon->size == size))
{
if (prev)
}
static void
-add_to_cache (GtkIconSet *icon_set,
- GtkStyleContext *style_context,
- GtkTextDirection direction,
- GtkStateType state,
- GtkIconSize size,
- gint scale,
- GdkPixbuf *pixbuf)
+add_to_cache (GtkIconSet *icon_set,
+ GtkStyleContext *style_context,
+ GtkTextDirection direction,
+ GtkStateType state,
+ GtkIconSize size,
+ gint scale,
+ GtkCssImageEffect effect,
+ GdkPixbuf *pixbuf)
{
CachedIcon *icon;
icon->state = state;
icon->size = size;
icon->scale = scale;
+ icon->effect = effect;
icon->pixbuf = pixbuf;
attach_to_style (icon_set, icon->style);